package com.es.www.patternforclass;

/**
 * @Created by michangtao
 * @Date 2022/5/17 13:15
 * @Description
 * 手机本来是不能使用220v的电压的，通过VoltageAdapter适配器，将220v转化成了5v的电压
 */
public class Phone {

    private VoltageAdapter voltageAdapter;

    public Phone(VoltageAdapter voltageAdapter) {
        this.voltageAdapter = voltageAdapter;
    }

    public void charge(){
        voltageAdapter.makeVoltage5();
        System.out.println("手机正在充电");
    }
}
